﻿
namespace Mulala.Cavan.Application.Seedwork
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.Contracts;
    using System.Linq;
    using Mulala.Cavan.Core.Message;

    /// <summary>
    ///     base abstract class implementing IFacade: 
    ///     IList&lt;Message&gt; Messages.
    ///     Derived class can provide interfaces to the data-storage
    ///     and use this Messages collection as the communication, 
    ///     to send information to the client (UI, Batch etc.)
    /// </summary>
    public abstract class AppService : IAppService
    {
        #region properties
        /// <summary>
        ///     Messages collection must be provided from caller as a reference.
        ///     Contained information (if any) should be handled
        /// </summary>
        public virtual IList<AppMessage> Messages { get; set; }
        #endregion properties

        #region constructor
        protected AppService()
        {
            Messages = new List<AppMessage>();
        }
        #endregion constructor
    }
}